Rapid growth of the "Internet," a worldwide communications network of computers, has stimulated the interest in distributed data processing. In a distributed data processing environment, a server can download an application to a client, and the client then executes the application. An even greater degree of sophistication in distributed processing is manifested in distributed data processing systems that allow a local data processing device to invoke methods on a remote host just as if they were implemented locally. In order for distributed data processing to function in an open network environment such as the Internet, it is necessary that the distributed applications be platform neutral. In other words, there is no way in such a networking environment for the server to know the computing platform with which it is communicating. Applications transmitted for remote execution must be able to function independent of the computing platform to which they are targeted.
Java is a programming language designed to be platform neutral. For this reason, it has rapidly become a popular programming language for distributed data processing.
Java source code is compiled to run on a Java Virtual Machine ("Java VM"). Any platform from which a Java VM has been implemented can execute Java applications. The Java VM interfaces the platform independent compiled Java source code to the platform on which the application is being executed. The Java VM is a software engine running on top of the hardware and operating system of the target platform.
Platform independency is achieved by the compilation of Java source code into a set of one byte digits called "byte code." A byte code may be viewed as a machine code for the Java VM, wherein each byte code corresponds to a Java VM instruction. The Java VM instructions are defined in the specifications for the Java VM. The byte code is platform independent. The Java VM then acts as an interpreter between the Java byte code and the specific system on which the Java program is executing.
Although platform independence is an advantage of Java, it is acquired at a price. Because Java is an interpreted programming language, Java applications execute more slowly than a similar program produced using a compiled language, such as C or C++, would execute. The Java Virtual Machine steps through the compiled Java program, typically referred to as a Java class file, byte code-by-byte code translating each into native instruction sequences on the fly. This process is slower in executing applications than are languages compiled and then loaded as a set of native machine instructions. In order to improve performance of Java applications, it is becoming more common now for Java interpreters to include "Just In Time" ("JIT") compilers. JIT compilers translate certain Java byte code segments into machine code for the particular hardware platform on which the Java VM is implemented. This translation occurs at one time and the block of compiled code is then stored for later execution.
Different Java VM implementations handle byte code interpretation in a variety of ways. Therefore, there can be a significant variation in performance among different Java VM implementations. The ability of the JIT within a particular Java VM implementation to optimally compile for the most commonly occurring sequences of byte codes is critical to the performance of that Java VM implementation. In order to improve the performance of the JIT, and its Java VM implementation, there is a need in the art for a method and apparatus of detecting, articulating and accurately measuring such commonly occurring byte code sequences.